package Class::Value::Net::NAPTR::UInt16;

# $Id: UInt16.pm 11258 2006-04-25 14:47:36Z ek $

use strict;
use warnings;


our $VERSION = '0.01';


use base 'Class::Value::Net';


sub is_well_formed_value {
    my ($self, $value) = @_;
    return unless defined $value;

    no warnings;
    # since this apparently has a charset handler now which allows only
    # digits, the only check we have left is the max range (negative numbers
    # don't work, because '-' is not a digit)
    # it's a little strange, because 'fjdkfj' and '-1' now yield
    # 'InvalidValue', whereas '1000000000000' yields a 'MalformedValue'
    # we don't want multiple exceptions for the same error, because they all
    # turn up in the epp response and the karlsplatz-guys seem quite picky
    # about that.
    # all in all: whatever.
    #$value < 0x10000;

    # 16 bit unsigned int
    $value + 0 eq $value && $value >= 0 && $value < 0x10000;
}


1;


__END__

=head1 NAME

Class::Value::Net - network-related value objects

=head1 SYNOPSIS

None yet (see below).

=head1 DESCRIPTION

None yet. This is an early release; fully functional, but undocumented. The
next release will have more documentation.

=head1 TAGS

If you talk about this module in blogs, on del.icio.us or anywhere else,
please use the C<classvaluenet> tag.

=head1 BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to
C<bug-class-value-net@rt.cpan.org>, or through the web interface at
L<http://rt.cpan.org>.

=head1 INSTALLATION

See perlmodinstall for information and options on installing Perl modules.

=head1 AVAILABILITY

The latest version of this module is available from the Comprehensive Perl
Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a CPAN
site near you. Or see <http://www.perl.com/CPAN/authors/id/M/MA/MARCEL/>.

=head1 AUTHORS

Marcel GrE<uuml>nauer, C<< <marcel@cpan.org> >>

Heinz Ekker C<< ek@univie.ac.at >>

=head1 COPYRIGHT AND LICENSE

Copyright 2007 by Marcel GrE<uuml>nauer

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

